/*
https://leetcode.cn/problems/smallest-number-with-all-set-bits/submissions/584374765/
100501. 仅含置位位的最小整数
*/
class Solution {
public:
    int smallestNumber(int n) {
        int num=0,a=1;
        while(n!=0){
            num=num|a;
            a<<=1;
            n>>=1;
        }
        return num;
    }
};